//
//  TempViewController.swift
//  Sina
//
//  Created by 王杰 on 15/11/16.
//  Copyright © 2015年 王杰. All rights reserved.
//

import UIKit

class TempViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "返回", style: .Plain, target: self, action: "back")
        self.title = "\(navigationController?.childViewControllers.count)耶"
        view.backgroundColor = UIColor.randomColor()
    }
    override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
        let temp = TempViewController()
        navigationController?.pushViewController(temp, animated: true)
    }
    
    @objc private func back() {
        navigationController?.popViewControllerAnimated(true)
    }
   
}
